import Vue from 'vue'
import Router from 'vue-router'
import Home from './../pages/Home/Home'

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/login',
      name: '登陆',
      icon: 'search',
      meta: {
        title: '登陆页面',
        icon: 'search'
      },
      component: () => import('../pages/Login/Login')
    },
    {
      path: '/',
      name: '首页',
      icon: 'home-o',
      meta: {
        title: '首页',
        showFooter: true
      },
      component: () => import('../pages/Home/Home')
    },
    {
      path: '/userControl',
      name: '用户管理',
      component: () => import('../pages/UserControl/UserControl')
    },
    {
      path: '/courseControl',
      name: '课程管理',
      component: () => import('../pages/CourseControl/CourseControl')
    },
    {
      path: '/addUser',
      name: '添加用户',
      component: () => import('../pages/AddUser/AddUser')
    },
    {
      path: '/addCourse',
      name: '添加课程',
      component: () => import('../pages/AddCourse/AddCourse')
    },
    {
      path: '/home',
      name: '首页',
      icon: 'home-o',
      component: Home,
      meta: {
        title: '首页',
        showFooter: true
      }
    },
    {
      path: '/editor',
      name: '编辑',
      icon: 'edit',
      meta: {
        title: '编辑',
        showFooter: true
      },
      component: () => import('../pages/Editor/Editor')
    },
    {
      path: '/',
      redirect: '/home',
      hidden: true
    },
    {
      path: '*',
      name: 'NotFound',
      hidden: true,
      meta: {
        title: '404'
      },
      component: () => import('../pages/404/NotFound')
    }
  ]
})
